home *** CD-ROM | disk | FTP | other *** search
/ Workbench Design / WB Collection.iso / workbench werkzeuge / memory & system tools / vmm / installvmm / english < prev    next >
Text File  |  1996-04-07  |  14KB  |  413 lines

  1. ; VMM Installer script by Martin Apel
  2. ; Installation script for VMM 3.3
  3.  
  4. (set @app-name "VMM")
  5.  
  6. (welcome "        Welcome to the VMM installation\n\n"
  7.          "       Virtual Memory for Amigas with MMU\n\n"
  8.          "        Copyright 1993-95 by Martin Apel\n\n"
  9.          "Novice   installs everything except the developer files.\n"
  10.          "Advanced installs everything without confirmation.\n"
  11.          "Expert   installs everything with confirmation of all actions.\n")
  12.  
  13. (if (= 0 @user-level) ; then
  14.     (set install_level %000111)
  15. ;else
  16.     (set install_level (askoptions (prompt "What do you want to install ?")
  17.                                    (help   @askoptions-help)
  18.                                    (choices "VMM" "Icons" "Documents" "Developer files" "Tools" "Rexx scripts")))
  19. )
  20.  
  21. (set def_help "\n\nIf you need more help, please refer to \"VMM.guide\"\n\n")
  22.  
  23. (set my_level @user-level)
  24. (user 2)
  25. (set vmmdest
  26.     ;get destination directory for "VMM"
  27.      (askdir (prompt "Select the directory where you want to put the VMM executable (and tools).")
  28.              (help   "This should be a directory where you can easily access VMM "
  29.                      "via Workbench or CLI/Shell." def_help
  30.                      @askdir-help)
  31.              (default @default-dest)
  32.              (disk)
  33.      )
  34. )
  35. (user my_level)
  36.  
  37. (set copy_vmm   (BITAND %000001 install_level))
  38. (set copy_icons (BITAND %000010 install_level))
  39. (set copy_docs  (BITAND %000100 install_level))
  40. (set copy_dev   (BITAND %001000 install_level))
  41. (set copy_tools (BITAND %010000 install_level))
  42. (set copy_rexx  (BITAND %100000 install_level))
  43.  
  44. ; Copy VMM files
  45.  
  46. (if copy_vmm
  47.   (
  48.     (set @default-dest vmmdest)
  49.     (set vmmtacked (tackon vmmdest "VMM"))
  50.  
  51.     ; ask, if we want to overwrite the old VMM if it exists
  52.     (set overwrite 1)
  53.     (if (exists "L:VMM-Handler")
  54.       (
  55.         (set old_version (getversion "l:VMM-Handler"))
  56.         (set old_ver (/ old_version 65536))
  57.         (set old_rev (- old_version (* old_ver 65536)))
  58.  
  59.         (set new_version (getversion "/l/VMM-Handler_4K"))
  60.         (set new_ver (/ new_version 65536))
  61.         (set new_rev (- new_version (* new_ver 65536)))
  62.  
  63.         (set overwrite (askbool (prompt "\nYou have VMM "
  64.                                          old_ver "." old_rev " already installed"
  65.                                         ".\nDo you wish to overwrite it with VMM "
  66.                                          new_ver "." new_rev " ?\n")
  67.                                 (help def_help @askbool-help)
  68.                                 (default 1)
  69.                                 (choices "Yes" "No"))
  70.  
  71.         )
  72.       )
  73.     )
  74.  
  75.     (if overwrite
  76.         (
  77.            ; detect the pagesize (4K or 8K)
  78.            (set pagesize (run "/tools/ShowPageSize"))
  79.  
  80.            (select pagesize
  81.              (abort "Internal error in Installer script")
  82.              ((set info_string "A pagesize of 4K is usable on your system")
  83.               (set default_choice 0))
  84.              ((set info_string "A pagesize of 8K is usable on your system")
  85.               (set default_choice 1))
  86.              ((set info_string "Either pages of 4K or 8K are usable on your system")
  87.               (set default_choice 0))
  88.            )
  89.  
  90.            (set my_choice (askchoice (prompt "\nPlease select the pagesize:\n\n"
  91.                                            info_string ".\n")
  92.                                    (help   def_help @askchoice-help)
  93.                                    (choices "4K pagesize" "8K pagesize")
  94.                                    (default default_choice))
  95.            )
  96.  
  97.            (select my_choice
  98.             (set sizestr "4K")
  99.             (set sizestr "8K")
  100.            )
  101.  
  102.            ; copy the new VMM file to the destination directory
  103.            (if copy_icons
  104.               ; then
  105.                 (copyfiles (prompt ("\nCopying VMM to %s." vmmdest))
  106.                            (help   def_help @copyfiles-help)
  107.                            (optional "oknodelete")
  108.                            (optional "askuser")
  109.                            (source "/")
  110.                            (choices  "VMM")
  111.                            (dest     vmmdest)
  112.                            (infos)
  113.                            (confirm)
  114.                 )
  115.               ; else
  116.                 (copyfiles (prompt ("\nCopying VMM to %s." vmmdest))
  117.                            (help   def_help @copyfiles-help)
  118.                            (optional "oknodelete")
  119.                            (optional "askuser")
  120.                            (source "/")
  121.                            (choices  "VMM")
  122.                            (dest     vmmdest)
  123.                            (confirm)
  124.                 )
  125.            )
  126.  
  127.            ; copy the catalog for VMM
  128. ;          not used in english version, because English is built in
  129. ;          (copyfiles (prompt "\nCopying VMM.catalog to LOCALE:catalogs/english.")
  130. ;                      (help   def_help @copyfiles-help)
  131. ;                      (optional "oknodelete")
  132. ;                      (optional "askuser")
  133. ;                      (source  "/catalogs/english/VMM.catalog")
  134. ;                      (dest    "LOCALE:catalogs/english")
  135. ;                      (confirm)
  136. ;          )
  137.  
  138.  
  139.  
  140.            ; copy the new VMM-Handler file to l: and rename it as "VMM-Handler"
  141.            (set handler_name (cat "/l/VMM-Handler_" sizestr))
  142.            (copyfiles (prompt "\nCopying VMM-Handler to l:.")
  143.                       (help   def_help @copyfiles-help)
  144.                       (optional "oknodelete")
  145.                       (optional "askuser")
  146.                       (source  handler_name)
  147.                       (dest    "l:")
  148.                       (newname "VMM-Handler")
  149.                       (confirm)
  150.            )
  151.  
  152.            ; copy the catalog for the VMM-handler
  153. ;          not used in english version, because English is built in
  154. ;          (copyfiles (prompt "\nCopying VMM-Handler.catalog to LOCALE:catalogs/english.")
  155. ;                      (help   def_help @copyfiles-help)
  156. ;                      (optional "oknodelete")
  157. ;                      (optional "askuser")
  158. ;                      (source  "/catalogs/english/VMM-Handler.catalog")
  159. ;                      (dest    "LOCALE:catalogs/english")
  160. ;                      (confirm)
  161. ;          )
  162.         )
  163.      )
  164.  
  165.  
  166.  
  167.     ; ask, if we want to overwrite the old preferences file
  168.     ; default: do overwrite preferences file
  169.     (set overwrite 1)
  170.     (if (exists "envarc:VMM.prefs")
  171.         (if (= 0 (askbool (prompt "\nYou have a preferences file already installed.\nDo you wish to overwrite it ?\n\n")
  172.                      (help "If you don't overwrite the prefs file it will be converted in the next step" @askbool-help)
  173.                      (default 0)
  174.                      (choices "Yes" "No")))
  175.               (set overwrite 0)
  176.         )
  177.     )
  178.  
  179.     (if overwrite
  180.       (
  181.         ; copy the new preferences file to env: and envarc:
  182.         (copyfiles (prompt ("\nCopying VMM.prefs to env:\n"))
  183.                    (help   def_help @copyfiles-help)
  184.                    (optional "oknodelete")
  185.                    (optional "askuser")
  186.                    (source  "/env/VMM.prefs")
  187.                    (dest    "env:")
  188.                    (confirm)
  189.         )
  190.         (copyfiles (prompt ("\nCopying VMM.prefs to envarc:\n"))
  191.                    (help   def_help @copyfiles-help)
  192.                    (optional "oknodelete")
  193.                    (optional "askuser")
  194.                    (source  "/env/VMM.prefs")
  195.                    (dest    "envarc:")
  196.                    (confirm)
  197.         )
  198.       )
  199.     ; else
  200.       (if (= 1 (askbool (prompt "The preferences file format has changed since V2.1\nDo you want to have it converted?"
  201.                      (help def_help @askbool-help)
  202.                      (default 1)
  203.                      (choices "Yes" "No"))))
  204.         (run "/tools/ConvVMMCfg")
  205.       )
  206.     )
  207.   )
  208. )
  209.  
  210. ; Copy docs
  211.  
  212. (if copy_docs
  213.     (
  214.       ;get destination directory for "VMM.guide"
  215.       (set doc_dir (tackon vmmdest "doc"))
  216.  
  217.       (if (AND (= 0 @user-level) (NOT (exists doc_dir)))
  218.           ; then
  219.           (makedir doc_dir (infos))
  220.       )
  221.  
  222.       (set vmmdocs
  223.            (askdir (prompt "Select the directory where you want to put\nthe documents and guides.")
  224.                    (help   "This should be the directory where you normally put your guides.\n\n"
  225.                            def_help @askdir-help)
  226.                    (default doc_dir)
  227.                    (newpath)
  228.                    (disk)
  229.            )
  230.       )
  231.  
  232.       (if copy_dev
  233.         (if copy_icons
  234.            ; then
  235.            (copyfiles (prompt ("\nCopying docs..."))
  236.                       (help   def_help @copyfiles-help)
  237.                       (optional "oknodelete")
  238.                       (optional "askuser")
  239.                       (source  "/doc")
  240.                       (choices "VMM.guide" "VMM_Rexx.guide" "VMMTools.guide" "VMM_lib.doc")
  241.                       (dest    vmmdocs)
  242.                       (infos)
  243.                       (confirm)
  244.            )
  245.            ; else
  246.            (copyfiles (prompt ("\nCopying docs..."))
  247.                       (help   def_help @copyfiles-help)
  248.                       (optional "oknodelete")
  249.                       (optional "askuser")
  250.                       (source  "/doc")
  251.                       (choices "VMM.guide" "VMM_Rexx.guide" "VMMTools.guide" "VMM_lib.doc")
  252.                       (dest    vmmdocs)
  253.                       (confirm)
  254.            )
  255.         )
  256.       ; else
  257.         (if copy_icons
  258.             ; then
  259.               (copyfiles (prompt ("\nCopying VMM.guide to " vmmdocs "."))
  260.                          (help   def_help @copyfiles-help)
  261.                          (optional "oknodelete")
  262.                          (optional "askuser")
  263.                          (source  "/doc")
  264.                          (choices "VMM.guide" "VMM_Rexx.guide" "VMMTools.guide")
  265.                          (dest    vmmdocs)
  266.                          (infos)
  267.                          (confirm)
  268.               )
  269.             ; else
  270.               (copyfiles (prompt ("\nCopying VMM.guide to " vmmdocs "."))
  271.                          (help   def_help @copyfiles-help)
  272.                          (optional "oknodelete")
  273.                          (optional "askuser")
  274.                          (source  "/doc")
  275.                          (choices "VMM.guide" "VMM_Rexx.guide" "VMMTools.guide")
  276.                          (dest    vmmdocs)
  277.                          (confirm)
  278.               )
  279.         )
  280.       )
  281.     )
  282. )
  283.  
  284. ; Copy developer files
  285.  
  286. (if copy_dev
  287.     (
  288.       (copylib (prompt ("\nCopying VMM.library to libs:."))
  289.                (help   def_help @copyfiles-help)
  290.                (optional "oknodelete")
  291.                (optional "askuser")
  292.                (source  "/Developer/libs/VMM.library")
  293.                (dest    "libs:")
  294.                (confirm)
  295.       )
  296.  
  297.       (if (exists ("fd:") (noreq))
  298.           ; then
  299.             (set fd_dir "fd:")
  300.           ; else
  301.             (set fd_dir
  302.                  (askdir (prompt "Select the directory where you want to put the fd file.")
  303.                          (help   def_help  @askdir-help)
  304.                          (default "SYS:")
  305.                          (disk)
  306.                  )
  307.             )
  308.       )
  309.  
  310.       (if (exists ("include:") (noreq))
  311.           ; then
  312.             (set inc_dir "include:")
  313.           ; else
  314.             (set inc_dir 
  315.                  (askdir (prompt "Select the directory where you want to put the include file.")
  316.                          (help   def_help  @askdir-help)
  317.                          (default "SYS:")
  318.                          (disk)
  319.                  )
  320.             )
  321.       )
  322.  
  323.       (if (exists ("lib:") (noreq))
  324.           ; then
  325.             (set lib_dir "lib:")
  326.           ; else
  327.             (set lib_dir
  328.                  (askdir (prompt "Select the directory where you want to put the lib file.")
  329.                          (help   def_help  @askdir-help)
  330.                          (default "SYS:")
  331.                          (disk)
  332.                  )
  333.             )
  334.       )
  335.  
  336.  
  337.       (copyfiles (prompt ("\nCopying VMM_lib.fd to " fd_dir "."))
  338.                  (help   def_help @copyfiles-help)
  339.                  (optional "oknodelete")
  340.                  (optional "askuser")
  341.                  (source  "/Developer/fd")
  342.                  (choices "VMM_lib.fd")
  343.                  (dest    fd_dir)
  344.                  (confirm)
  345.       )
  346.  
  347.       (copyfiles (prompt ("\nCopying VMM_stat.h to " inc_dir "."))
  348.                  (help   def_help @copyfiles-help)
  349.                  (optional "oknodelete")
  350.                  (optional "askuser")
  351.                  (source  "/Developer/include")
  352.                  (choices "VMM_Stat.h")
  353.                  (dest    inc_dir)
  354.                  (confirm)
  355.       )
  356.  
  357.       (copyfiles (prompt ("\nCopying VMM_lib.lib to " lib_dir "."))
  358.                  (help   def_help @copyfiles-help)
  359.                  (optional "oknodelete")
  360.                  (optional "askuser")
  361.                  (source  "/Developer/lib")
  362.                  (choices "VMM_lib.lib")
  363.                  (dest    lib_dir)
  364.                  (confirm)
  365.       )
  366.     )
  367. )
  368.  
  369. ; Copy tools
  370.  
  371. (if copy_tools
  372.   (
  373.   if copy_icons
  374.     ; then
  375.       (copyfiles (prompt ("\nCopying tools to " vmmdest "."))
  376.                  (help   def_help @copyfiles-help)
  377.                  (optional "oknodelete")
  378.                  (optional "askuser")
  379.                  (source  "/tools")
  380.                  (choices "VMMStat" "VMMUsage" "VMMUsageCLI")
  381.                  (dest    vmmdest)
  382.                  (infos)
  383.                  (confirm)
  384.       )
  385.     ; else
  386.       (copyfiles (prompt ("\nCopying tools to " vmmdest "."))
  387.                  (help   def_help @copyfiles-help)
  388.                  (optional "oknodelete")
  389.                  (optional "askuser")
  390.                  (source  "/tools")
  391.                  (choices "VMMStat" "VMMUsage" "VMMUsageCLI")
  392.                  (dest    vmmdest)
  393.                  (confirm)
  394.       )
  395.   )
  396. )
  397.  
  398. ;
  399.  
  400. ; Copy ARexx scripts
  401.  
  402. (if copy_rexx
  403.   (copyfiles (prompt ("\nCopying ARexx scripts to REXX:"))
  404.              (help   def_help @copyfiles-help)
  405.              (optional "oknodelete")
  406.              (optional "askuser")
  407.              (source  "/rexx")
  408.              (choices "stat_on.vmm" "stat_off.vmm" "show.vmm" "hide.vmm")
  409.              (dest    "REXX:")
  410.              (confirm)
  411.   )
  412. )
  413.